package com.cssw.fyzb.wap.service;

import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.wap.model.vo.TextKindListVo;
import com.cssw.fyzb.wap.model.vo.TextKindVo;
import com.ydn.appserver.MinaAppClient;
import com.ydn.appserver.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @Auther: zzf
 * @Date: 2020/12/15 11:59
 * @Description:
 */
@Service
public class TextService extends BaseService {


    @Autowired
    private MinaAppClient busiClient;

    /**
     * 文本分类查询
     *
     * @return com.sw.fyzb.wap.framework.web.domain.AjaxResult
     * @Param [kindCode]
     **/
    public AjaxPage<TextKindListVo> testKindList(String kindCode, int pageNumber, int pageSize) {
        Request request = new Request("ListTextKind");
        request.setParameter("kindCode", kindCode);
        request.setParameter("pageNumber", pageNumber);
        request.setParameter("pageSize", pageSize);
        return convertPage(busiClient.send(request), TextKindListVo.class);
    }

    /**
     * 查询文本
     *
     * @return com.cssw.fyzb.base.web.domain.AjaxData<com.cssw.fyzb.wap.model.vo.TextKindVo>
     * @Param [textCode] 文本编码
     **/
    public AjaxData<TextKindVo> getSysText(String textCode) {
        Request request = new Request("GetSysText");
        request.setParameter("textCode", textCode);
        return convertData(busiClient.send(request), TextKindVo.class);
    }
}
